﻿using System;

namespace SverigesRadio.SverigesRadioApp.Business
{
    public abstract class ServiceCallerBase<T> 
    {
        public abstract void CallAsync(Uri serviceUri);

        public virtual void CallAsync(Uri serviceUri, params string[] queryStrings)
        {
            string queryString = string.Join("&", queryStrings);
            CallAsync(serviceUri, queryString);
        }

        public virtual  void CallAsync(Uri serviceUri, string queryString)
        {
            var uri = queryString.Length == 0 ? serviceUri : new Uri(string.Format("{0}?{1}", serviceUri, queryString));

            CallAsync(uri);
        }


    }
}
